package com.liyao.storehouse.api.controller;

import cn.hutool.json.JSONObject;
import com.liyao.storehouse.api.base.ThirdPartyCallBaseController;
import com.liyao.storehouse.api.utill.R;
import com.liyao.storehouse.pojo.storage.outBound;
import com.liyao.storehouse.service.storageService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @program: storehouse
 * @description:
 * @author: liu yan
 * @create: 2024-12-04 18:05
 */
@RestController
@RequestMapping("/api/booher/outboundRecord")
public class OutboundRecordApiController extends ThirdPartyCallBaseController<T> {
    @Resource
    storageService service;
    @PostMapping("/getoutboundRecordCount")
    public R getMaterialCount (@RequestBody JSONObject body, HttpServletRequest request) {
        //验证token
//        JSONObject token = verificationToken(request);
//        if (!token.getStr("errcode").equals("0")) {
//            return R.ok().put("data", token);
//        }
//
//        //验证参数
//        JSONObject pass = verificationParamsPage(body, true, "");
//        if (!pass.getStr("errcode").equals("0")) {
//            return R.ok().put("data", pass);
//        }
//
//        //添加接口调用日志
//        saveClientCallLog(body, request);

        //根据参数查询出库历史

        return R.ok().put("data", service.getoutboundRecordCount(Integer.parseInt(body.get("pageNum").toString()),Integer.parseInt(body.get("pageSize").toString())));
    }
}
